//
// Created by ECNU on 2024/2/20.
//

#include <nanofaiss/Index.h>

#include <nanofaiss/utils/distances.h>
#include <nanofaiss/impl/AuxIndexStructures.h>
#include <nanofaiss/impl/DistanceComputer.h>
#include <nanofaiss/impl/FaissAssert.h>


#include <cstring>

namespace faiss {

void Index::train(idx_t n, const float* x) {
    // do nothing
}

void Index::assign(idx_t n, const float* x, idx_t* labels, idx_t k) const {
    std::vector<float> distances(n * k);
    search(n, x, k, distances.data(), labels);
}

void Index::add_with_ids(
        faiss::idx_t n,
        const float* x,
        const faiss::idx_t* xids) {
    FAISS_THROW_MSG("add_with_ids not yet implemented");
}

size_t Index::sa_code_size() const {
    FAISS_THROW_MSG("standalone codec not implemented for this type of index");
}

void Index::sa_encode(idx_t, const float*, uint8_t*) const {
    FAISS_THROW_MSG("standalone codec not implemented for this type of index");
}

void Index::sa_decode(idx_t, const uint8_t*, float*) const {
    FAISS_THROW_MSG("standalone codec not implemented for this type of index");
}

}